package ch10oopexer1;

import java.util.Scanner;

public class TeacherTest {

    public static void main(String[] args)throws Exception {
        Scanner scan = new Scanner(System.in);
            System.out.print("姓名：");
            String name =scan.next();
            System.out.print("年龄：");
            int age =scan.nextInt();
            System.out.print("学校：");
            String school =scan.next();
            if(age<22){
                throw new Exception("年龄小于22");
            }
            Teacher teacher = new Teacher(name,age,school);
            teacher.show();

    }
}
